package com.example.web.entity;

import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Customer {
    private Long id;
    
    @NotBlank(message = "客户姓名不能为空")
    private String name;
    
    @NotBlank(message = "公司名称不能为空")
    private String companyName;
    
    private String phone;
    
    private String email;
    
    @NotBlank(message = "客户状态不能为空")
    private String status; // 潜在客户、已联系客户、已流失
    
    private String source;
    
    private String remark;
    
    private Long creatorId;
    
    // 创建人姓名，用于显示（非数据库字段）
    private String creatorName;
    
    private Integer isDeleted; // 0: 未删除, 1: 已删除
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}